package com.zhaohanlin.start;

import org.junit.Test;

/**
 * @author zhaohanlin
 */
public class CatTest {
    //静态类
    static  class Cat {
        //姓名属性,年龄属性 特征属性
        private String name;
        private Integer age;

        //setGet方法
        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getAge() {
            return age;
        }

        public void setAge(Integer age) {
            this.age = age;
        }

    }
    @Test
    public void classMemberCall(){
       Cat cat01 =new Cat();
        cat01.setName("贝贝");
        System.out.println(cat01.getAge());
        Cat cat02 =new Cat();
        System.out.println(cat02.getName());
    }
    @Test
    public void add(){
        int no1=1;
        boolean flag =false;
        for (int i=0;i<50;i++){
            if (no1==1||no1==8){
                flag=!flag;
            }
            no1=flag?no1+1:no1-1;

        }
        System.out.println(no1);
    }



}
